package com.shnu.work.repository;

import com.shnu.work.entity.AdministrationInformationEntity;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author Shinomiya Kaguya
 */
@Repository
public interface AdministrationInformationRepository extends CrudRepository<AdministrationInformationEntity, Long> {

    /**
     * 通过账号查找
     *
     * @param adminAccount 账号
     * @return 结果
     */
    AdministrationInformationEntity getAdministrationInformationEntityByAdministrationAccount(String adminAccount);

    /**
     * 查询所有管理员的信息
     *
     * @return 管理员list
     */
    @Query(value = "select * from administration_information where is_deleted = 0", nativeQuery = true)
    List<AdministrationInformationEntity> listAllAdminInfo();
}
